I have only tested on the sample input. Made in about 3 to 4 hours of coding (plus time spent theorizing). This could likely be made quite a lot faster with one or two more well-placed arms.